<?php
class UserList
{
    public function __construct()
    {
    }
    
    /**
     * This method generate table of users.
     * 
     * @param usersArray    Array, the resulting query to the database.
     * 
     * @return string-html code, which formed a table of users.
     */
    public function getUserTable( $usersArray )
    {
        $users = array();
        $link = 'http://' . $_SERVER['HTTP_HOST'] . '/php/search.php?id=';
        for ( $i = 0; $i < count( $usersArray ); ++$i )
        {
            $users[] = array
            (
                'first_name' => $usersArray[$i]['first_name'],
                'last_name'  => $usersArray[$i]['last_name'],
                'user_id'    => $link . $usersArray[$i]['user_id'],
                'user_email' => $usersArray[$i]['email']
            );
        }
        return $users;
    }
}
?>